import Login from "../page/Login";
import Home from "../page/Home/index";
import Home2 from "../page/Home/index2";
import Layout from "../page/Layout";
import Board from "../page/Board";
import About from "../page/About";
import NotFound from "../page/NotFound";

// 导入 路由
import { createBrowserRouter } from 'react-router-dom'
// import { createBrowserRouter, createHashRouter } from 'react-router-dom'



const router = createBrowserRouter([
  {
    path: '/',
    element: <Layout />,
    children: [
      {
        path: 'about',
        element: <About />
      },
      // 设置默认的 二级路由
      {
        index: true,
        // path: '',
        element: <Board />
      }
    ]
  },
  {
    path: '/login',
    element: <Login />
  },
  {
    path: '/home',
    element: <Home />
  },
  {
    path: '/:id/:name',
    element: <Home2 />
  },
  {
    path: '*',
    element: <NotFound />
  }
])

export default router